package spitfire.ksim.algorithm;

public class FuzzyEntry {
	private String nodeId;
	private String sensorType;
	private String sd; //Semantic description
	private FuzzyRule valueRule;
	private FuzzyRule timeRule;
	
	public FuzzyEntry(String nodeId, String sensorType,
			String sd, FuzzyRule valueRule, FuzzyRule timeRule) {
		this.nodeId = nodeId;
		this.sensorType = sensorType;
		this.sd = sd;
		this.valueRule = valueRule;
		this.timeRule = timeRule;
	}

	public void setNodeId(String nodeId) {
		this.nodeId = nodeId;
	}
	
	public String getNodeId() {
		return nodeId;
	}
	
	public void setSensorType(String sensorType) {
		this.sensorType = sensorType;
	}
	
	public String getSensorType() {
		return sensorType;
	}
	
	public void setSd(String sd) {
		this.sd = sd;
	}
	
	public String getSd() {
		return sd;
	}

	public void setRule(FuzzyRule valueRule, FuzzyRule timeRule) {
		this.valueRule = valueRule;
		this.timeRule = timeRule;
	}

	public FuzzyRule getValueRule() {
		return valueRule;
	}
	
	public FuzzyRule getTimeRule() {
		return timeRule;
	}

	public boolean match(String nodeId, String sensorType) {
		return (nodeId.equals(this.nodeId) && sensorType.equals(this.sensorType));
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("FuzzyEntry [nodeId=");
		builder.append(nodeId);
		builder.append(", sensorType=");
		builder.append(sensorType);
		builder.append(", sd=");
		builder.append(sd);
		builder.append("]");
		return builder.toString();
	}
	
	
}
